package com.fand.manager.task;

import javax.annotation.Resource;

import com.fand.manager.service.ISysUserESIndexRecordService;
import com.xxl.job.core.handler.annotation.XxlJob;
import lombok.extern.slf4j.Slf4j;
import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
import org.springframework.stereotype.Component;

/**
 * Author: zhangjiabin
 * Email: javaboyok@163.com
 * CreateDate: 2021/6/22
 * Version: 1.0
 */
@Slf4j
@Component
public class SysUserLoginRecordTask {

    @Resource
    private ThreadPoolTaskExecutor       threadPoolTaskExecutor;
    @Resource
    private ISysUserESIndexRecordService sysUserESIndexRecordService;

    @XxlJob("SysUserLoginRecordTask")
    public void exec(){
        log.info("定时任务执行 SysUserLoginRecordTask exec");
        threadPoolTaskExecutor.execute(()-> sysUserESIndexRecordService.recode2Mongo());
    }
}
